// pages/foodEnergyDetail/foodEnergyDetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    leftIndex: 0,
    leftData: [
      "糖类",
      "米面制品及零食类",
      "泡面",
      "酒类",
      "饮料类",
      "肉类及其制品",
      "奶制品",
      "蛋类",
      "坚果类",
      "酱料",
      "水果类",
      "豆制品",
    ],
    rightData: [
      // "糖类",
      [
        {name:"1勺蜂蜜20g",value:"64.2",run:"1.0",time:"10"},
        {name:"5颗酥糖100g",value:"436",run:"6.6",time:"67"},
      ],
      // "米面制品及零食类",
      [
        {name:"1把葡萄干20g",value:"68.2",run:"1.0",time:"10"},
        {name:"1个蛋挞30g",value:"93",run:"1.4",time:"14"},
        {name:"1个烧麦50g",value:"119",run:"1.8",time:"18"},
        {name:"1个汤包50g",value:"119",run:"1.8",time:"18"},
        {name:"年糕100g",value:"154",run:"2.3",time:"24"},
        {name:"1个奶油泡芙60g",value:"164",run:"2.5",time:"25"},
        {name:"薯片1份30g",value:"164.4",run:"2.5",time:"25"},
        {name:"8颗鲜板栗100g",value:"185",run:"2.8",time:"28"},
        {name:"1块披萨80g",value:"188",run:"2.9",time:"29"},
        {name:"鸡蛋饼100g",value:"200",run:"3.0",time:"31"},
        {name:"1根油条60g",value:"231.6",run:"3.5",time:"35"},
        {name:"1个三文治100g",value:"234",run:"3.6",time:"36"},
        {name:"1个大叉烧包120g",value:"235.4",run:"3.6",time:"36"},
        {name:"1包卫龙辣条65g",value:"269",run:"4.1",time:"41"},
        {name:"1块巧克力50g",value:"293",run:"4.5",time:"45"},
        {name:"肯德基薯条",value:"298",run:"4.5",time:"46"},
        {name:"面包100g",value:"312",run:"4.7",time:"48"},
        {name:"2个豆沙包100g",value:"319",run:"4.9",time:"49"},
        {name:"黄油面包100g",value:"329",run:"5.0",time:"50"},
        {name:"绿豆糕100g",value:"349",run:"5.3",time:"53"},
        {name:"香酱饼100g",value:"354",run:"5.4",time:"54"},
        {name:"蛋黄酥100g",value:"386",run:"5.9",time:"59"},
        {name:"苏打饼干100g",value:"408",run:"6.2",time:"62"},
        {name:"1块奶油蛋糕120g",value:"453.6",run:"6.9",time:"69"},
        {name:"鲜肉蛋黄粽200g",value:"470",run:"7.2",time:"72"},
        {name:"1个油饼120g",value:"478.8",run:"7.3",time:"73"},
        {name:"桃酥100g",value:"481",run:"7.3",time:"74"},
        {name:"1碗饺子8个",value:"500",run:"7.6",time:"77"},
        {name:"麻花100g",value:"524",run:"8.0",time:"80"},
        {name:"曲奇饼干100g",value:"546",run:"8.3",time:"84"},
        {name:"金丝枣甜粽200g",value:"560",run:"8.5",time:"86"},
        {name:"1个煎饼180g",value:"599.4",run:"9.1",time:"92"},
        {name:"1个蛋黄月饼150g",value:"600",run:"9.1",time:"92"},
        {name:"1碗汤圆8个",value:"622",run:"9.5",time:"95"},
        {name:"1个五仁月饼150g",value:"624",run:"9.5",time:"96"},
        {name:"1个麦当劳鸡腿汉堡200g",value:"640",run:"9.7",time:"98"},
        {name:"1份香油炒面300g",value:"1221",run:"18.6",time:"187"},
      ],
      // "泡面",
      [
        {name:"1包老坛酸菜牛肉面120g（含调料）",value:"509",run:"7.7",time:"78"},
        {name:"红烧牛肉面120g（含调料）",value:"536.4",run:"8.2",time:"82"},
      ],
      // "酒类",
      [
        {name:"中国红酒100ml",value:"91",run:"1.4",time:"14"},
        {name:"1瓶啤酒330ml",value:"102.3",run:"1.6",time:"16"},
        {name:"白酒100ml",value:"295",run:"4.5",time:"45"},
      ],
      // "饮料类",
      [
        {name:"雀巢咖啡31g",value:"134",run:"2.0",time:"21"},
        {name:"1瓶可乐330ml",value:"148.5",run:"2.3",time:"23"},
        {name:"1瓶雪碧330ml",value:"151.8",run:"2.3",time:"23"},
        {name:"1瓶咖啡275ml",value:"168",run:"2.6",time:"26"},
        {name:"1瓶统一阿萨姆原味奶茶550ml",value:"253",run:"3.9",time:"39"},
        {name:"1瓶珍珠奶茶550ml",value:"286",run:"4.4",time:"44"},
      ],
      // "肉类及其制品",
      [
        {name:"1根火腿30g",value:"63.3",run:"1.0",time:"10"},
        {name:"1份牛肉干20g",value:"110",run:"1.7",time:"17"},
        {name:"培根100g",value:"181",run:"2.8",time:"28"},
        {name:"3个可乐鸡翅120g",value:"207",run:"3.2",time:"32"},
        {name:"3个烤鸡翅120g",value:"222",run:"3.4",time:"34"},
        {name:"1根腊肠50g",value:"292",run:"4.4",time:"45"},
        {name:"1个炸鸡腿120g",value:"313",run:"4.8",time:"48"},
        {name:"1根香肠75g",value:"381",run:"5.8",time:"58"},
        {name:"北京烤鸭100g",value:"436",run:"6.6",time:"67"},
        {name:"1份烤肉300g",value:"462",run:"7.0",time:"71"},
        {name:"红烧肉100g",value:"513",run:"7.8",time:"79"},
      ],
      // "奶制品",
      [
        {name:"1瓶安慕希205ml",value:"203",run:"3.1",time:"31"},
        {name:"哈根斯达冰激凌100g",value:"220",run:"3.3",time:"34"},
      ],
      // "蛋类",
      [
        {name:"1个煎荷包蛋50g",value:"97.5",run:"1.5",time:"15"},
        {name:"鸭蛋1个70g",value:"126",run:"1.9",time:"19"},
      ],
      // "坚果类",
      [
        {name:"1把葵花籽15g",value:"92.4",run:"1.4",time:"14"},
        {name:"1包每日坚果25g",value:"125.5",run:"1.9",time:"19"},
        {name:"1把松子仁20g",value:"139.6",run:"2.1",time:"21"},
        {name:"1把炒花生20g",value:"147",run:"2.2",time:"23"},
        {name:"2个山核桃20g",value:"150",run:"2.3",time:"23"},
      ],
      // "酱料",
      [
        {name:"1勺花生酱20g",value:"118.8",run:"1.8",time:"18"},
        {name:"1勺芝麻酱20g",value:"123.6",run:"1.9",time:"19"},
      ],
      // "水果类",
      [
        {name:"1根香蕉150g",value:"136.5",run:"2.1",time:"21"},
        {name:"榴莲100g",value:"150",run:"2.3",time:"23"},
        {name:"菠萝蜜100g",value:"160",run:"2.4",time:"25"},
        {name:"1个牛油果150g",value:"256",run:"3.9",time:"39"},
        {name:"红枣100g",value:"264",run:"4.0",time:"40"},
      ],
      // "豆制品",
      [
        {name:"5个油豆腐100g",value:"244",run:"3.7",time:"37"},
        {name:"豆腐皮100g",value:"447",run:"6.8",time:"68"},
      ],
    ],
    scrollTop:0,
    searchVal:""
  },
  toggleLeftIndex(e) {
    let leftIndex = e.currentTarget.dataset.index;
    this.setData({
      leftIndex,
      scrollTop:0
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      leftIndex:options.leftIndex,
      searchVal:options.searchVal
    })  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})